<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Admin_Assort extends Controller {
    
    //保存数据
    public function action_saveInfo(){

        $id=$this->request->post('model_id');

        $pid=$this->request->post('model_pid');

        $caption=$this->request->post('caption');

        $url=$this->request->post('url');

        $isdisabled=$this->request->post('isdisabled');

        $model_post=new Model_Admin_Assort();

        echo $model_post->saveInfo($id,$pid,$caption,$url,$isdisabled);
    }
    //删除数据
    public function action_deleteInfo(){

        $id=$this->request->post('id');

        $Model_Admin=new Model_Admin_Common();

        echo $Model_Admin->deleteInfo("assort",$id);

    }
    //根据id加载数据
    public function action_loadInfoById(){

        $id=$this->request->post('id');
        $sql="select t.assortid model_id,t.pid model_pid,
            t.caption,t.isdisabled
            from assort t
            where t.assortid='$id'
            limit 1";

        $Model_Admin=new Model_Admin_Common();
        
        echo $Model_Admin->loadInfoById($sql);
    }

}
?>